<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>invoke (Spec::Mocks::BaseExpectation)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File vendor\plugins\rspec/lib/spec/mocks/message_expectation.rb, line 72</span>
      <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">invoke</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>)
        <span class="ruby-ivar">@order_group</span>.<span class="ruby-identifier">handle_order_constraint</span> <span class="ruby-keyword kw">self</span>

        <span class="ruby-keyword kw">begin</span>
          <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@exception_to_raise</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Class</span>
            <span class="ruby-ivar">@exception_instance_to_raise</span> = <span class="ruby-ivar">@exception_to_raise</span>.<span class="ruby-identifier">new</span>
          <span class="ruby-keyword kw">else</span> 
            <span class="ruby-ivar">@exception_instance_to_raise</span> = <span class="ruby-ivar">@exception_to_raise</span>
          <span class="ruby-keyword kw">end</span>
          <span class="ruby-constant">Kernel</span><span class="ruby-operator">::</span><span class="ruby-identifier">raise</span> <span class="ruby-ivar">@exception_to_raise</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@exception_to_raise</span>.<span class="ruby-identifier">nil?</span>
          <span class="ruby-constant">Kernel</span><span class="ruby-operator">::</span><span class="ruby-identifier">throw</span> <span class="ruby-ivar">@symbol_to_throw</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@symbol_to_throw</span>.<span class="ruby-identifier">nil?</span>

          <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@method_block</span>.<span class="ruby-identifier">nil?</span>
            <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">invoke_method_block</span>(<span class="ruby-identifier">args</span>)
          <span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@args_to_yield</span>.<span class="ruby-identifier">nil?</span>
            <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">invoke_with_yield</span>(<span class="ruby-identifier">block</span>)
          <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@consecutive</span>
            <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">invoke_consecutive_return_block</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>)
          <span class="ruby-keyword kw">else</span>
            <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">invoke_return_block</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>)
          <span class="ruby-keyword kw">end</span>
        <span class="ruby-keyword kw">ensure</span>
          <span class="ruby-ivar">@received_count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
        <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">end</span></pre>
</body>
</html>